
export default function request(configs) {
    // 从 storage 中获取 cookie信息
    const cookies = wx.getStorageSync('cookies')
    return new Promise((resolve, reject) => {
        wx.request({
            // url: 'http://localhost:3000' + configs.url,
            url: 'http://192.168.198.143:3000' + configs.url,
            data: configs.data,
            header: {
                ...configs.header,
                cookie: cookies || ''
            },
            success: (res) => {
                resolve(res)
            },
            fail: (e) => {
                reject(e)
            }
        })
    })
}